//
//  ZYSetCurrentEecordCell.m
//  优学荟管理系统
//
//  Created by Ethan on 2017/9/5.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "ZYSetCurrentEecordCell.h"
#import "ZYSetTheCuModel.h"
@implementation ZYSetCurrentEecordCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }
    
    
    return self;
}

- (void)setAssaginZYSetTheCuModel:(ZYSetTheCuModel *)model{
    
    self.timeLabel.text = model.withdrawTime;
    self.rmbLabel.text = [NSString stringWithFormat:@"-%@",model.withdrawAmount];
   // 0：提现中，1：财务拒绝，2：财务同意，3：终审拒绝，4：终审同意，5：已结算
    
    if (0 == [model.withdrawFlag integerValue]) {
        self.typeLabel.text =@"(提现中)";
    }else if (1 == [model.withdrawFlag integerValue]){
        self.typeLabel.text = @"(财务拒绝)";
    }else if (2 == [model.withdrawFlag integerValue]){
        self.typeLabel.text = @"(财务同意)";
    }else if (3 == [model.withdrawFlag integerValue]){
        self.typeLabel.text = @"(终审拒绝)";
    }else if (4 == [model.withdrawFlag integerValue]){
        self.typeLabel.text = @"(终审同意)";
    }else if (5 == [model.withdrawFlag integerValue]){
        self.typeLabel.text = @"(已提现)";
        
    }
    
    
}


- (void)setUpSuperView{
    

    
    self.timeLabel = [UILabel new];
//    self.timeLabel.backgroundColor = [UIColor redColor];
    self.timeLabel.font = [UIFont systemFontOfSize:12];
    self.timeLabel.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.timeLabel];
    
    self.detailButtom = [UIButton buttonWithType:(UIButtonTypeCustom)];
//    self.detailButtom.backgroundColor = [UIColor greenColor];
    [self.detailButtom setTitle:@"详情 >" forState:(UIControlStateNormal)];
    self.detailButtom.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    self.detailButtom.titleLabel.font = [UIFont systemFontOfSize:14];
    [self.detailButtom setTitleColor:ColorRGB(51, 51, 51) forState:(UIControlStateNormal)];
    [self.contentView addSubview:self.detailButtom];
    
    self.typeLabel = [UILabel new];
//    self.typeLabel.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.typeLabel];
    
    self.rmbLabel = [UILabel new];
//    self.rmbLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.rmbLabel];
    
    
 
    
    self.timeLabel.text = @"张宇";
    self.timeLabel.font = [UIFont systemFontOfSize:14];
    self.timeLabel.textColor = ColorRGB(102, 102, 102);
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    
        make.left.offset(20);
        make.top.offset(15);
    }];
    
    self.rmbLabel.textColor = ColorRGB(51, 52, 52);
    self.rmbLabel.font = [UIFont systemFontOfSize:15];
    [self.rmbLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.timeLabel);
        make.top.equalTo(self.timeLabel.mas_bottom).offset(15);
    }];
    
    
    self.typeLabel.textColor = ColorRGB(52, 52, 52);
    self.typeLabel.font = [UIFont systemFontOfSize:14];
    [self.typeLabel  mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.rmbLabel.mas_right).offset(0);
        make.top.centerY.equalTo(self.rmbLabel);
    }];
    

    [self.detailButtom setTitleColor:ColorRGB(102, 102, 102) forState:(UIControlStateNormal)];
    [self.detailButtom mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-20);
        make.top.centerY.equalTo(self.contentView);
        make.width.offset(100);
    }];

    


    
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(self.rmbLabel).offset(15);
    }];
    
}




























@end
